BEGIN {
	#初始化设定packet被drop的数目
	highest_packet_id = 0;
	byBS = 0;
	byAP = 0;
	send_byAP = 0;
	WLAN0 = 0;
	WLAN1 = 0;
	from5to6plus = 0;
	from5to6recv = 0;
	sum_recvu_67 = 0;
	sum_recvu_68 = 0;
	from5to6 = 0;
	sum_drop = 0;
}
{
	#如果第5列是“---”,显然为WLAN网络的trace格式
	if($5 == "---") 
	{
		action = $1;
		time = $2;
		report_node = $3;
		layer = $4;
		packet_id = $6;
		packet_type = $7;
		packet_size = $8;
	}
	else
	{	action = $1;
		time = $2;
		from_node = $3;
		to_node = $4;
		packet_type = $5;
		packet_size = $6;
		seq_num = $11;
		packet_id = $12;
	}
	if(action == "s" && report_node == "_11_" && packet_type == "cbr")
	{
		WLAN0++;
		}
	if(action == "s" && report_node == "_12_" && packet_type == "cbr")
	{
		WLAN1++;
		}
	if(action == "r" && from_node == 10 && to_node == 0 && packet_type == "cbr")
	{
		byAP++;
		}
	if(action == "+" && from_node == 0 && to_node == 5 && packet_type == "cbr")
	{
		byBS++;
		}
	if(action == "+" && from_node == 5 && to_node == 6 && packet_type == "cbr")
	{
		if(recv_time5to6[packet_id] == 0)
		{
			from5to6++;
			recv_time5to6[packet_id] = time;
			}
		else
			;
	}
	if(action == "r" && from_node == 6 && to_node == 7 && packet_type == "cbr")
	{
		if(recv_time6to7[packet_id] == 0)
		{
			from6to7++;
			recv_time6to7[packet_id] = time;
			}
		else
			;
	}	
	

}
END{
	printf(" byBS: %d \n", byBS);
	printf(" byAP: %d \n", byAP);
	printf(" WLAN0: %d \n", WLAN0);
	printf(" WLAN1: %d \n", WLAN1);
	printf(" from5to6: %d \n", from5to6);
	printf(" from6to7: %d \n", from6to7);
	}

